<pre>
<?php

class zuAgent
{
	// stored in DB
	//DB also contains static userId in container class
	protected $recSongId;
	protected $basicValuesCSV;
	protected $addionalValuesCSV;	
	protected $basicValues;
	protected $addionalValues;
	protected $fitness;

	function CreateRandom( $agentInd )
	{
		$this->recSongId = -1;
		for( $featInd = 0; $featInd < 5; $featInd++ ) {
			$val = rand( 0, 20000 );
			$val = ($val * 0.0001) - 1.0;
			$val = round( $val, 4 );
			$this->basicValues[] = $val;
			$this->addionalValues[] = 0.0;
		}
		$this->basicValuesCSV = implode( ",", $this->basicValues );
		$this->addionalValuesCSV = implode( ",", $this->addionalValues );
	}

	function OutputPrint()
	{
		echo "recSongId: $this->recSongId\n";
		echo "basicValuesCSV: $this->basicValuesCSV\n";
		echo "addionalValuesCSV: $this->addionalValuesCSV\n";
	}
}

// execution start
for( $agentInd = 0; $agentInd < 10; $agentInd++ ) {
	$agents[$agentInd] = new zuAgent();
	$agents[$agentInd]->CreateRandom( $agentInd );
}
for( $agentInd = 0; $agentInd < 10; $agentInd++ ) {
	$agents[$agentInd]->OutputPrint();
}
echo "--------\n";

$babies = $agents;
for( $babyInd = 0; $babyInd < 10; $babyInd++ ) {
	$babies[$babyInd]->OutputPrint();
}
echo "--------\n";

?>
</pre>
